/**
 * Created by Administrator on 2017/7/24 0024.
 */
(function ($) {
    var count=0;
    window.setInterval(function(){
        $.ajax({
            url: "login/getSession",
            type: "post",
            async: "false",
            // data: { token: localStorage.getItem("token")},
            success: function (msg) {
                if(msg!=""&&msg!=null){
                    count++;
                    if(count==1){
                        $.alert("您的账号已经在另一处登录，您被迫下线！","警告", function() {
                            window.location.href="login.html"
                        });
                    }

                }


                /* alert(msg);
                 window.location.href="login.html"*/
            }
        })
    },2000);
})(jQuery);
function checkUserOnline() {
    $.ajax({
        url: "login/getSession",
        type: "post",
        async: "false",
        // data: { token: localStorage.getItem("token")},
        success: function (msg) {
            var count=0;

            if(msg!=""&&msg!=null){
                $.alert("您的账号已经在另一处登录，您被迫下线！","警告", function() {
                    window.location.href="login.html"
                });
            }


            /* alert(msg);
             window.location.href="login.html"*/
        }
    })
}